/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2023-04-08
 * Time: 13:54
 */

import java.util.Scanner;

public class Test {
    public static int missingNumber(int[] nums) {
        int size = nums.length;
        for (int i = 0; i < nums.length; i++) {
            size -= nums[i];
            size += i;
        }
        return size;
    }
    public static void main(String[] args) {
        int[] arr = {3,2,1,0,5};
        int ret = missingNumber(arr);
        System.out.println(ret);
    }
}
